from django import template

register = template.Library()

@register.filter(name='to_change')
def to_sex(value, arg='zh'):
    # 0-->女；1-->男
    # 0-->Female；1-->Male
    sex = {
        'zh': ('女', '男'),
        'en': ('Female', 'Male')
    }
    # 0,'zh'
    # sex['zh'][0]
    return sex[arg][value]
